package com.youedata.util;

import cn.stylefeng.roses.core.datascope.DataScope;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.youedata.modular.entity.TeacherUserRel;
import com.youedata.modular.mapper.TeacherUserRelMapper;
import com.youedata.sys.core.util.UserHolder;
import com.youedata.sys.modular.system.entity.Dept;
import com.youedata.sys.modular.system.mapper.DeptMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.stream.Collectors;

@Component
@Slf4j
public class DataScopeKit {

    @Autowired
    private DeptMapper deptMapper;

    @Autowired
    private TeacherUserRelMapper teacherUserRelMapper;

    public static DataScope init() {
        DataScope dataScope = new DataScope();
        dataScope.setScopeName("dept_id");
        dataScope.setDeptIds(UserHolder.getDeptIds());
        return dataScope;
    }


}
